package com.invite.me.ui.xiaoxi;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.invite.me.R;
import com.invite.me.base.BaseActivity;
import com.invite.me.beans.adpater.InformationxxAdptater;
import com.invite.me.beans.bilnddatabean.InformationBean;
import com.invite.me.beans.presenter.InformationxxPresenter;
import com.invite.me.wlqq.Contract;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

import java.util.ArrayList;
import java.util.List;

public class InformationxxActivity extends BaseActivity implements View.OnClickListener,Contract.BaseView {
    InformationxxAdptater informationxxAdptater;
    List<InformationBean> list = new ArrayList<>();
    private SmartRefreshLayout myxiangqinsmartrefresh;
    InformationxxPresenter informationxxPresenter;

    @Override
    protected void initView() {
        informationxxPresenter = new InformationxxPresenter(this);
        informationxxPresenter.yanzhengma();
        //  initdata();
        ImageView imagefanhui = findViewById(R.id.imagefanhui);
        imagefanhui.setOnClickListener(this);

        myxiangqinsmartrefresh = findViewById(R.id.myxiangqinsmartrefresh);
        myxiangqinsmartrefresh.setEnableRefresh(false);//是否启用下拉刷新功能
        myxiangqinsmartrefresh.setEnableLoadMore(true);//是否启用上拉加载功能

        RecyclerView xiaoxilist = findViewById(R.id.xiaoxilist);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        xiaoxilist.setLayoutManager(layoutManager);
        informationxxAdptater = new InformationxxAdptater(R.layout.xiaoxi_list, list);
        xiaoxilist.setAdapter(informationxxAdptater);
        informationxxAdptater.notifyDataSetChanged();


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.imagefanhui:
                finish();
                break;

        }

    }

    @Override
    protected int getActivityLayoutId() {
        return R.layout.activity_informatio;
    }

    @Override
    protected void loadData() {

    }

    public void initdata() {
        for (int i = 0; i < 1; i++) {
            list.add(new InformationBean("NOTKEEP", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "女"));
            list.add(new InformationBean("OKKEEP", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "女"));
            list.add(new InformationBean("OKPRICE", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "女"));
            list.add(new InformationBean("OKOK", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "女"));
            list.add(new InformationBean("NOTKEEP", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "男"));
            list.add(new InformationBean("OKKEEP", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "男"));
            list.add(new InformationBean("OKPRICE", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "男"));
            list.add(new InformationBean("OKOK", "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3852329400,3428852864&fm=26&gp=0.jpg", "2020年7月10日 23:32", "相亲", "男"));

        }


    }


    @Override
    public void setPresenter(Contract.BasePresenter basePresenter) {
        if (informationxxPresenter instanceof Contract.BasePresenter) {
            this.informationxxPresenter = (InformationxxPresenter) basePresenter;
        }
    }

    @Override
    public void onDataSucess(Object o) {

    }

    @Override
    public void onDataFaile(Object o) {

    }

    @Override
    public void onComplete() {

    }
}